<template>
	<div class="tmp" >
		<ul class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell mui-media" v-for='item in newslist'>
				<router-link v-bind="{to:'/news/newsshow/'+item.id}" class="mui-navigate-right">
					<img class="mui-media-object mui-pull-left" :src="item.img_url">
					<div class="mui-media-body">
						{{item.title}}
						<p class='mui-ellipsis' style='color: dodgerblue'>
							发布时间：{{item.add_time | moments}} &nbsp;点击：{{item.click}}</p>
					</div>
				</router-link>
			</li>
		</ul>
	</div>		
</template>

<script>
	import common from '../field/getfield.js'
	export default{
		data(){
			return {
				newslist:[]
			}
		},
		methods:{
			getnewslist(){
			    let url = common.apidomain+"/api/getnewslist";
			    console.log(url)
				this.$http.get(url)
					.then(res=>{
					    this.newslist=res.body.message
						console.log(this.newslist)
					})
			}
		},
		created(){
		    this.getnewslist();
		}
	}
</script>

<style class='scoped'>
	.mui-media-body h3{
		font-size: 16px;
	}
</style>